//package com.uphone.kingmall.activity.chat;
//
//import android.app.Activity;
//import android.content.Context;
//import android.view.View;
//import android.view.ViewGroup;
//
//import com.blankj.utilcode.util.LogUtils;
//import com.uphone.kingmall.utils.ConstansUtils;
//
//import io.rong.imkit.RongIM;
//import io.rong.imkit.model.UIConversation;
//import io.rong.imkit.widget.adapter.ConversationListAdapter;
//import io.rong.imlib.model.CSCustomServiceInfo;
//import io.rong.imlib.model.Conversation;
//
///**
// * Created by weiqinxiao on 15/11/5.
// */
//public class ConversationListAdapterEx extends ConversationListAdapter {
//    private final Activity context;
//
//    public ConversationListAdapterEx(Activity context) {
//        super(context);
//        this.context = context;
//    }
//
//    @Override
//    protected View newView(Context context, int position, ViewGroup group) {
//        return super.newView(context, position, group);
//    }
//
//    @Override
//    protected void bindView(View v, int position, UIConversation data) {
//        if (data != null) {
//            if (data.getConversationType().equals(Conversation.ConversationType.CUSTOMER_SERVICE))
//                data.setUnreadType(UIConversation.UnreadRemindType.REMIND_ONLY);
//        }
//        super.bindView(v, position, data);
//        ConversationListAdapter.ViewHolder holder = (ConversationListAdapter.ViewHolder) v.getTag();
//        String conversationSenderId = data.getConversationSenderId();
//        String conversationTargetId = data.getConversationTargetId();
//        LogUtils.e("id:" + conversationSenderId + "    " + conversationTargetId);
//        holder.contentView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                try {
//                    CSCustomServiceInfo.Builder csBuilder = new CSCustomServiceInfo.Builder();
//                    final CSCustomServiceInfo csInfo = csBuilder.nickName("融云").build();
//                    RongIM.getInstance().startCustomerServiceChat(context, ConstansUtils.CSCustomServiceId, "", csInfo);
//                } catch (Exception e) {
//                    LogUtils.e("e:" + e.toString());
//                    e.printStackTrace();
//                }
//            }
//        });
//        holder.leftImageLayout.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                CSCustomServiceInfo.Builder csBuilder = new CSCustomServiceInfo.Builder();
//                final CSCustomServiceInfo csInfo = csBuilder.nickName("融云").build();
//                RongIM.getInstance().startCustomerServiceChat(context, ConstansUtils.CSCustomServiceId, "", csInfo);
//            }
//        });
//        holder.leftImageLayout.setOnLongClickListener(new View.OnLongClickListener() {
//            @Override
//            public boolean onLongClick(View v) {
//                return true;
//            }
//        });
//        holder.rightImageLayout.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                CSCustomServiceInfo.Builder csBuilder = new CSCustomServiceInfo.Builder();
//                final CSCustomServiceInfo csInfo = csBuilder.nickName("融云").build();
//                RongIM.getInstance().startCustomerServiceChat(context, ConstansUtils.CSCustomServiceId, "", csInfo);
//
//            }
//        });
//        holder.rightImageLayout.setOnLongClickListener(new View.OnLongClickListener() {
//            @Override
//            public boolean onLongClick(View v) {
//                return true;
//            }
//        });
//    }
//}
